package com.leen.user.repository;

import com.leen.user.entity.YxUser;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface YxUserRepository extends CrudRepository<YxUser,Long> , JpaSpecificationExecutor<YxUser> {

    @Query(value="select count(*) from YxUser a where a.username like ?1")
    int findUniqueUsername(String username);

    @Query(value="select count(*) from YxUser a where a.phone = ?1")
    int findPhone(String phone);

    @Query(value="select count(*) from YxUser a where a.loginType like ?1")
    int findLoginType(String loginType);
}
